import { Global, Module } from "@nestjs/common";
import { ConfigModule } from "@nestjs/config";
import { WinstonModule } from "nest-winston";
import config from "src/config/config";
import { DbModule } from "src/db/db.module";
import winstonLogger from "./logger/winston.config";



@Global()
@Module({
	imports: [
		ConfigModule.forRoot({
			isGlobal:true,
			load:[config]
		}),
		WinstonModule.forRoot({
			transports: winstonLogger.transports,
			format: winstonLogger.format,
			defaultMeta: winstonLogger.defaultMeta,
			exitOnError: false, // 防止意外退出
		}),
		DbModule,
	]
})
export class GlobalModule {}
